<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>OnErrorGoto</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">OnErrorGoto()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#006666"><b>OnErrorGoto</b></font>(?LabelAddress)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Changes the action taken when an error occurs to jump to the specified label address and continue 
program execution there. After the jump to the label, the functions of this library can be used 
to get further information about the error. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>?LabelAddress</i></td>
<td width="90%"> 
 
The address of a label in the program to jump to. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>Remarks</b></p><blockquote>



The program stack will not be adjusted before jumping to the label, so local variables 
should not be accessed as they may not be reachable anymore. It is also not safe to continue normal 
program execution after an error as things like the return address of a procedure may be wrong 
if the stack is no longer correct. The best practice is just to gather and display information 
about the error and then exit the program. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2"><font color="#006666">  MessageRequester</font>("OnError test", "Test start")

<font color="#006666">  OnErrorGoto</font>(?ErrorHandler)
<font color="#006666">  Pokes</font>(10, "Hello World") <font color="#006666">; Cause a #PB_OnError_InvalidMemory error</font>
  
<font color="#006666">  MessageRequester</font>("OnError test", "This should never be displayed")
  <b><font color="#006666">End</font></b>
  
  ErrorHandler:
<font color="#006666">  MessageRequester</font>("OnError test", "The following error happened: " +<font color="#006666"> ErrorMessage</font>())
  <b><font color="#006666">End</font></b>
</font></pre>

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=onerrorexit.html>OnErrorExit()</a> - <a href=index.html>OnError Index</a> - <a href=raiseerror.html>RaiseError()</a> -&gt;



</body></html>